#pragma once

#include "effectbase.h"
#include <osg\Vec4>
#include <QObject>
#include "animationpathcontrol.h"
#include "fbxanimationcontrol.h"

namespace VrDataCore
{
	class VRDATACORE_EXPORT AnimationEffect:public EffectBase
	{
	public:
		AnimationEffect();

		enum AnimationType
		{
			None,
			AnimationPath,
			FbxAnimation,
		};
	protected:
		~AnimationEffect();
		void setAnimationEffect(float fromsecond,float tosecond,int nlooptimes);
	public:
		virtual void buildPropertyMap();
		virtual osg::ref_ptr<CoreBase::ActorBase> clone();
		virtual void apply(CoreBase::ActorBase* actor);
		virtual void unApply(CoreBase::ActorBase* actor);
		virtual void pause(bool);
		void setAnimationEffect(osg::Vec3 effect);
		osg::Vec3 getAnimationEffect();
	private:
		osg::Vec3													_animationEffect;
		osg::ref_ptr<CoreBase::AnimationPathCallbackControl>		_animationPathControl;
		osg::ref_ptr<CoreBase::FbxAnimationControl>					_fbxAnimationControl;
		osg::ref_ptr<osg::Node>										_effectNode;
		float														_fromSecond;
		float														_toSecond;
		int															_loopTimes;
		AnimationType												_animationType;
	};
}